<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>校事达-重置密码页</title>
    <link rel="stylesheet" href="./layui2_9/css/layui.css">
</head>

<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">
	<a href="index.html">
		<img src="./layui2_9/images/xsd.png" alt="" style="width: 70%; height: 100%;" />
	</a>
</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">任务中心</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a href="adminRegister.html">注册</a></li>
            <li class="layui-nav-item"><a href="login.html">登录</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item"><a href="">校园即时服务平台</a></li>
            </ul>
        </div>
    </div>

    <!-- 内容主体区域-->
    <div class="layui-body ">

        <div style="padding: 30px;" class="layui-fluid">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <span class="layui-badge-dot"></span> <span
                        class="layui-badge-dot layui-bg-orange"></span> <span
                        class="layui-badge-dot layui-bg-green"></span> <span
                        class="layui-badge-dot layui-bg-cyan"></span> <span
                        class="layui-badge-dot layui-bg-blue"></span> <span
                        class="layui-badge-dot layui-bg-black"></span> <span
                        class="layui-badge-dot layui-bg-gray"></span>
                    <fieldset class="layui-elem-field layui-field-title"
                              style="margin-top: 30px;">
                        <legend>重置密码</legend>
                    </fieldset>
                </div>
            </div>

            <div class="layui-row">
                <div class="layui-col-md3">&nbsp;</div>
                <div class="layui-col-md6">
                    <fieldset class="layui-elem-field">
                        <legend>填入信息</legend>
                        <div class="layui-field-box">
                            <form id="reform" class="layui-form layui-form-pane"
                                  lay-filter="formFilter" action="login.html" method="post">


                                <div class="layui-form-item">
                                    <div class="layui-input-inline">
                                        <input type="text" name="email" lay-verify="email" placeholder="邮箱" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-input-inline">
                                        <button type="button" class="layui-btn layui-btn-primary" onclick="countTime()" id="code-btn">发送验证码</button>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <div class="layui-input-inline">
                                        <input type="text" name="code" lay-verify="code" placeholder="验证码" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <div class="layui-input-inline">
                                        <input type="text" name="password" lay-verify="password" placeholder="新密码" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <button class="layui-btn" lay-submit="reform" lay-filter="reform">重置</button>
                                </div>
                            </form>
                            <a href="login.html">返回登录</a>
                        </div>
                    </fieldset>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © - 联系校事达官方客服：6666666
    </div>
</div>

</body>

<script src="./layui2_9/layui.js"></script>

<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
        //监听导航点击
        element.on('nav(test)', function (elem) {
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>
<script>
    layui.use(['form', 'laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //自定义验证规则
        form.verify({
            studentid: function (value) {
                if (value.length < 3) {
                    return '学号至少得3个字符啊';
                }
            },
            name: function (value) {
                if (value.length < 1) {
                    return '姓名至少得1个字符啊';
                }
            },
            password: [/(.+){3,12}$/, '密码必须3到12位']
        });

        //监听提交
        form.on('submit(reform)', function (data) {
            /*layer.alert(JSON.stringify(data.field), {
                title : '最终的提交信息'
            })*/
            //return false;
        });
    });
</script>
<script type="text/javascript">
    var form;
    layui.use(['layedit', 'form'], function () {
        form = layui.form;
    });

    //加载layui中的jq
    layui.use(['jquery', 'layer'], function () {
        var $ = layui.$, //重点处
            layer = layui.layer;

        $(function () {

            form.on('select(schoolFilter0)', function (data) {
                $("#schoolname").val(this.innerHTML);
            });

            $.post(
                "register.html",
                function (data) {
                    var obj = JSON.parse(data);
                    var str = "";
                    for (var i = 0; i < obj.length; i++) {
                        var optionStr = "";
                        optionStr += "<option value='" + obj[i].schoolid + "'>" + obj[i].name + "</option>";
                        $("#schoolid").append(optionStr);
                        form.render('select', 'formFilter');

                        $("#schoolname").val(obj[0].name);
                    }
                }
            );
        });

    });
</script>

<script>
    var time = 0;
    var timeID = null;
    function countTime(){
        time = 60;
        timeID = window.setInterval(function(){
            if(time > 1 ){
                time--;
                var codeBtn = document.getElementById("code-btn");
                codeBtn.setAttribute("class","layui-btn layui-btn-disabled");
                codeBtn.innerHTML = "验证码已发送（" + time + "）";
            }else{
                var codeBtn = document.getElementById("code-btn");
                codeBtn.setAttribute("class","layui-btn layui-btn-primary");
                codeBtn.innerHTML = "发送验证码";
                window.clearInterval(timeID);
            }
        },1000);
    }
</script>

</html>
